<include file="Public/head" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<style type="text/css">
    #start_time,#end_time
    ,#confirm_start_time,#confirm_end_time{background: rgba(0, 0, 0, 0) url("http://img4.isou365.cn/paimai/yunying/images/yun_tubiao1.jpg") no-repeat scroll 0 0;border: medium none;cursor: pointer;font-size: 12px; padding-right: 28px;text-align: center;width: 88px;}
</style>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar" menu="cjgl.czqr"  />
    <div class="mianR">
        <div class="yuyue">
            <ul>
                <li onclick="change_search(0);get_list(0);" class="yuCurrent">待确认</li>
                <li onclick="change_search(1);get_list(1);">跟踪中</li>
                <li onclick="change_search(2);get_list(2);">流拍</li>
                <li onclick="change_search(3);get_list(3);">确认成功</li>
                <li onclick="change_search(5);get_list(5);">确认失败</li>
                <li onclick="change_search(4);get_list(4);">磋商</li>
                <!--(1 待预约,2 预约成功,3 预约失败,4 待检测,5 检测通过,6 检查失败)-->
            </ul>
            <input type="hidden" name="status" value="0" />
        </div>
        <div class="yuSuo clearfix" style="float:left;">
            <form id="searchFrom">
                <input id="status" name="status" type="hidden" value="{$params.status}"/>
                <div id="search1" style="margin-right: 10px;float:left;">
                    <input type="text" id="start_time" name="trace_start_time" value="{$params.trace_start_time}" placeholder="跟踪时间" readonly /><em></em>
                    <input type="text" id="end_time" name="trace_end_time" value="{$params.trace_end_time}" placeholder="跟踪时间" readonly />
                </div>
                <div id="search2">
                    <input type="text" id="confirm_start_time" name="confirm_start_time" value="{$params.confirm_start_time}" placeholder="确认时间" readonly /><em></em>
                    <input type="text" id="confirm_end_time" name="confirm_end_time" value="{$params.confirm_end_time}" placeholder="确认时间" readonly />
                </div>
                <div class="zhuang-tai">
                <select id="location_area" name="location_area" class="branch_company">
                    <if condition="count($bc_city) gt 1">
                        <option value="">请选择所在地</option>
                    </if>
                    <volist name="bc_city" id="city">
                        <option value="{$key}">{$city}</option>
                    </volist>
                </select>
                </div>

                <input type="text" name="order_no" value="{$params.order_no}"  placeholder="拍卖单号"  class="suoDian suoDian1">
                <input type="button" onclick="search();" value="搜索" class="suoSou" style="width:80px;">
                <div id="search3">
                    <input type="button" onclick="resetSearch();" value="重置" class="suoSou" style="width:80px;">
                </div>
            </form>
        </div>
        <div class="listBox" id="listBox">

        </div>
        <div class="clear"></div>
    </div>
</div>
<script type="text/javascript">
        $("#confirm_start_time").ymdateplugin({
//            showTimePanel: true,
//            changeMonth: true,
//            changeYear: true
        });
        $("#confirm_end_time").ymdateplugin({
//            showTimePanel: true,
//            changeMonth: true,
//            changeYear: true
        });
    get_list(0);
    function get_list(status) {
        $('input[name=status]').val(status);
        $.get("/AuOrder/owner_confirm_list", {"status": status}, function (data) {
            $("#listBox").html(data);
        }, "html");
    }

    function get_page(p) {
        var get_params = $("#searchFrom").serialize()+"&p="+p;
        $.get("/AuOrder/owner_confirm_list", get_params, function (data) {
            $("#listBox").html(data);
        }, "html");
    }

    function is_assigned(order_id) {
        var param = {'order_id': order_id, 'type': 'owner_confirm'};
        $.get("/AuOrder/is_order_assigned", param, function (data) {
            if (data.code == '526') {
                shibai_alert(data.msg, 2000, function () {
                    window.location.reload()
                });
            } else if (data.code != '200') {
                //发生异常
                shibai_alert(data.msg, 2000, function () {
                    window.location.reload()
                });
            } else {
                window.open('/AuOrder/owner_confirm_detail/order_id/' + order_id)
            }
        }, "json");
    }
    function send_sms(order_id, owner_id, obj) {
        var param = {
            'order_id': order_id,
            'owner_id': owner_id
        };
        $.get("/AuOrder/send_sms", param, function (data) {
            if (data.code == '200') {
                btn_alert(data.msg, 2, function () {
                    window.location.reload()
                });
            } else {
                shibai_alert(data.msg);
            }
        }, "json");
    }
    function search() {
        $.get("/AuOrder/owner_confirm_list", $("#searchFrom").serialize(), function (data) {
            $("#listBox").html(data);
        }, "html");
    }

    $("#search1").hide();
    $("#search2").hide();
    function change_search(st) {
        var s1 = $("#search1"), s2 = $("#search2"), s3 = $("#search3");
        if (st == 0 || st == 2 || st == 5) {
            clear_params();
            s1.hide();
            s2.hide();
            s3.show();
        }
        if (st == 1) {
            clear_params();
            s1.show();
            s2.hide();
        }
        if (st == 3 || st == 4) {
            clear_params();
            s1.hide();
            s2.show();
        }
        if (st == 1 || st == 3 || st == 4) {
            clear_params();
            s3.show();
        }
    }

    function clear_params() {
        $("#order_no").val("");
        $("#start_time,#confirm_start_time").val("");
        $("#end_time,#confirm_end_time").val("");
    }
</script>
<include file="Public/foot" />